<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorator="layout/default">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>价格列表</title>
</head>
<body>
	<div layout:fragment="content">
		<div class="row" style="margin-bottom: 12px;">
            <div th:replace="fragments/searchBox::topSearch"></div>
            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
                <shiro:hasPermission name="price:new">
                    <a type="button" class="btn btn-sm btn-success pull-right"
                        title="创建新价格表" th:href="@{/prices/new}">创建新价格表</a>
                </shiro:hasPermission>
            </div>
        </div>
        
		<div class="row">
			<div class="col-lg-12 col-md-12 col-sm-12 xol-xs-12">
				<div th:unless="${#lists.isEmpty(page.list)}"
					th:replace="price/index::showPriceList(${page.list})"></div>
				<div
					th:replace="fragments/pagination::pagination(${'/prices'}, ${page})"></div>
			</div>
		</div>
	</div>
	
	<div class="table-responsive" th:fragment="showPriceList(priceList)">
		<table class="table table-striped table-hover table-condensed">
			<thead>
				<tr>
					<th>价目表</th>
					<th>币别</th>
					<th>生效日期</th>
					<th>终止日期</th>
				</tr>
			</thead>
			<tbody>
				<tr th:each="priceHeader : ${priceList}" th:object="${priceHeader}">
					<td><a href="#" th:href="@{/prices/{id}(id=*{headerId})}"
						th:text="*{name}"> </a></td>
					<td th:text="*{currency}"></td>
					<td th:text="*{#dates.format(startDate, 'yyyy-MM-dd')}"></td>
					<td><span th:if="*{endDate}" th:text="*{#dates.format(endDate, 'yyyy-MM-dd')}"></span></td>
				</tr>
			</tbody>
		</table>
	</div>
</body>
</html>
